OpenBuildings GenerativeComponents Help

string

A string value is a sequence of zero or more text characters.

GCScript supports two ways of specifying string values, Pascal style (which uses apostrophes) and C style (which uses quotation marks). (The styles are named after the programming languages Pascal and C.) We recommend using Pascal style because it's usually cleaner; however, either style is equally acceptable, and strings written in either style may be freely intermixed.

Pascal style strings (apostrophes)

To specify a string value, enclose the text characters within apostrophes.

Examples

'I think, therefore I am!'
'12.34'
''      // An empty string.

To include an apostrophe character, itself, within a string, specify two apostrophes in a row.

Example

"She said, "It''s nice to meet you."'

Backslash characters (\), which often appear in file paths, don't require any special processing.

Example

'C:\My Files\Survey Data.xls'

C style strings (quotation marks)

To specify a string value, enclose the text characters within quotation marks.

Examples

"I think, therefore I am!"
"12.34"
""      // An empty string.

To include a quotation character, itself, within a string, preface it with a backslash character (\).

Example

"She said, \"It's nice to meet you.\""

To include a backslash character, itself, within a string, specify two backslashes in a row.

Example

"C:\\My Files\\Survey Data.xls"